package com.ellecity06.cwhiskymall.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.ellecity06.common.base.BaseAdapter
import com.ellecity06.common.ktx.load
import com.ellecity06.cwhiskymall.bean.response.NewerLearningResponse
import com.ellecity06.cwhiskymall.databinding.ItemNewerLearningBinding

/**
 * @author ellecity06
 * @time 2024/12/24 17:46
 * @des
 */
class NewerLearningAdapter : BaseAdapter<NewerLearningResponse, ItemNewerLearningBinding>() {
    override fun inflateBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): ItemNewerLearningBinding {
        return ItemNewerLearningBinding.inflate(layoutInflater, parent, false)
    }

    override fun convert(binding: ItemNewerLearningBinding, position: Int, item: NewerLearningResponse) {
        binding.ivThumb.load(context, item.imageUrl)
        binding.tvTitle.text = item.title
    }
}